<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--
@html_name: 12promise读取文件
@description: The past cannot be redeemed, the future can be changed.
@author: Jason Black
@create: 2023/6/26 08:28:58
-->
<script>
  const fs = require('node:fs')
  const p = new Promise((resolve,reject)=>{
      fs.readFile('../DATA/data1.md',(err, data)=>{
          if (err) {
              throw err
          }
          console.log(data.toString())
      });
  })
  p.then(value => {
      console.log(value.toString())
  },reason => {
      console.error(reason)
  })
</script>
</body>
</html>